#ifndef __APP_CAN_H_
#define __APP_CAN_H_

/* Includes ------------------------------------------------------------------*/ 
//#include "mid_can.h"
#include "can_Cfg.h"
/* Private define ------------------------------------------------------------*/
#define PDU_MESSAGE_CYCLE_TIME_SET		(100U)		/* 100ms */

/* Private typedef -----------------------------------------------------------*/
typedef enum{
	CAN_SLEEP = 0,
	CAN_WORKING
}can_workState;
typedef struct {
	can_workState   enWorkState;
	uint8_t   u8Timer1msFlag; 
	uint8_t   u8Timer10msFlag;
}struct_CanCtrl_t;


/* Private variables ----------------------------------------------------------*/
extern can_state_t	can0_State;

extern void can_Init(uint8_t instance);

extern Enum_Result_t CanUser_DisableCommunication( void );
extern Enum_Result_t CanUser_EnableCommunication( void );

extern void can_1msTimer(void);
extern void can_10msTimer(void);
extern void can_sysevent_handler(uint8_t *p_event);
extern uint32_t can_message_handler(uint8_t *p_message);
extern void can_service(void);
extern uint32_t can_is_sleep(void);

#endif


